<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>我的藏酒</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<include file="public/comm"/>
		<style>
			.dz_xz{width: 100%;margin-top: 0.6em;background: #fff;padding: 0.6em;}
			.dz_xz .dz_ico{width: 10%;float: left;color: #d82b34;padding-top: 0.7em;}
			.dz_xz .dz_info{width: 80%;float: left;}
			.dz_xz .dz_info p{height: 1.8em;}
			.dz_xz .dz_info p span{padding-left: 2em;}
			.dz_xz .dz_rt_ico{width: 10%;float: left;color: #949494;padding-top: 0.7em;}
			.dz_main{width: 100%;margin-top: 1em;background: #fff;padding: 0.6em;}
			.dz_sp_m{border-bottom: dashed 1px #e1e1e1;padding-bottom: 0.8em;}
			.dz_main .dz_pp1{line-height: 2.4em;}
			.dz_main .dz_pp1 a{padding-left: 0.4em;}
			.dz_main .dz_lt{width: 35%;float: left;}
			.dz_main .dz_lt img{width: 90%;}
			.dz_main .dz_rt{width: 65%;float: right;padding-left: 0.6em;}
			.dz_main .mui-table-view-cell>a:not(.mui-btn){margin: -11px -30px;}
			.dz_wl span{float: right;}
			.dz_wl_pri{line-height: 2.6em;text-align: right;}
			.dz_wl_pri em{color: #f04020;}
			.dz_wl_js{width: 100%;height: 3em;background: #fff;line-height: 3em;text-align: right;position: fixed;bottom: 0;left: 0;}
			.dz_wl_js span:last-child{width: 30%;height: 100%;display: inline-block;background: #d82b34;text-align: center;color: #fff;margin-left: 0.6em;}

		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar1 mui-bar-nav fs_xl">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title fs_xl">厂家邮寄订单</h1>
		</header>
		<div class="mui-content fs_xl">
			<div class="dz_xz cls">
				<div class="dz_ico">
					<i class="mui-icon mui-icon-location"></i>
				</div>
				<div class="dz_info">
					<p class="fs_m">{$address.consignee}<span>{$address.mobile}</span></p>
					<p class="fs_xs">{$address.address}</p>
				</div>
				<div class="dz_rt_ico">
					<a href="{:U('/Mobile/User/address_list',array('source'=>'cellar_peisong'))}"  class="mui-icon mui-icon-arrowright"></a>
				</div>
			</div>
			<div class="dz_main cls">
				<p class="fs_m dz_pp1"><i class="mui-icon mui-icon-home fs_xxi"></i>
					<a href="javascript:;">{$goodinfo.suppliers_name}</a>
				</p>
				<div class="dz_sp_m cls">
					<div class="dz_lt">
						<img src="{$goodinfo.original_img}" />
					</div>
					<div class="dz_rt">
						<p class="fs_m">藏酒主题：<span>{$goodinfo.theme}</span></p>
						<p class="fs_m">香&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;型：<span>{$goodinfo.aroma}</span></p>
						<p class="fs_m">藏酒类型：<span>{$goodinfo.type}</span></p>
						<p class="fs_m">藏酒地址：<span>{$goodinfo.suppliers_name}</span></p>
					</div>
				</div>
				<div class="dz_wl mui-table-view-cell">
					<a id="check_bm" href="#middlePopover" class="mui-navigate-right fs_m">选择物流<span class="shipping_name"></span></a>
				</div>
				<div class="dz_wl_pri">
					<span class="fs_m">总计：<em>¥40.00</em></span>
				</div>
			</div>
			<div class="dz_wl_js">
				<span>待支付¥<em class="price_total">40.00</em></span><span id="extract">提交订单</span>
			</div>
		</div>
		<div id="middlePopover" class="mui-popover" style="height: 180px;">
			<div class="mui-scroll-wrapper">
				<div class="mui-scroll" id="xz_bm">
					<ul class="mui-table-view">
						<volist name="shippingList" id="vo">
							<li class="mui-table-view-cell bm_xz" shipping_code="{$vo.code}">
								<a href="#">{$vo.name}<span class=""></span></a>
							</li>
						</volist>
					</ul>
				</div>
			</div>
			<div class="xz_btn fs_xl">
				<a class="fs_m">确认</a>
			</div>
		</div>
<script type="text/javascript">
	$(document).ready(function(){
		$("#extract").click(function(){
			//提取藏酒
			var orderid = {$order_goodsinfo['order_id']};
			var rec_id = {$order_goodsinfo['rec_id']};
			var goods_id = {$order_goodsinfo['goods_id']};
			var type = 0;//提酒
			var from_user_id = {$user_id};
			var type1 = {$type};
			var to_user_id = "";
			//赠送的藏酒提取
			if(type1 == 2){
				to_user_id = {$id};
			}
			//获取地址
			var address_id = {$address['address_id']};
			//运费
			var shipping_price = $(".price_total").html();
			//获取快递id
			var shipping_code = $(".check").attr("shipping_code");
			var shipping_name = $("#check_bm span").text();//快递
			
			if(!shipping_name){
				alert("请选择物流");
				return false;
			}
			var extract_type = 0;//快递配送
			//获取选中的藏酒编号
			var bottle_num = "{$order_goodsinfo['bottle_num1']}";
			var num = {$order_goodsinfo['num']};
			$.ajax({
				type:"POST",
				url:"/Mobile/User/cellar_oprate",
				data:{"order_id":orderid,"rec_id":rec_id,"goods_id":goods_id,"types":type,"to_user_id":to_user_id,
					"from_user_id":from_user_id,"address_id":address_id,"bottle_num":bottle_num,
					"num":num,"shipping_price":shipping_price,"shipping_code":shipping_code,
					"shipping_name":shipping_name,"extract_type":extract_type},
				dataType:"json",
				success:function(data){
					if(data.status != 1){
						alert(data.msg);
					}else{
						location.href = "/mobile/User/surePay/id/"+data.data;
					}
				}
			});
		});
	});
</script>
		<script type="text/javascript">
			mui.init();
			mui('.mui-scroll-wrapper').scroll();
			$(function(){
				$("#xz_bm li").toggle(function(){
					$(this).addClass("check");
					$(this).find("span").addClass("active");
					$(this).siblings().find("span").removeClass("active");
					$(this).siblings().find("i").remove();
					$(this).siblings().removeClass("check");
					$(this).find("span").append('<i class="mui-icon mui-icon-checkmarkempty fs_xxi"></i>');
				},function(){
					$(this).removeClass("check");
					$(this).find("span").removeClass("active");
					$(this).find("i").remove();
				});
				$(".xz_btn").click(function(){
					var aa=$(".check").text();
					$("#check_bm span").text(aa);
					mui('.mui-popover').popover("hide");
				})
			})
		</script>
	</body>

</html>